﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.bonus {
    import Classes.*;
    import Modules.workers.*;

    public class WorkerBonus extends HarvestBonus {

        private var m_featureName:String;
        private var m_harvestableResource:HarvestableResource;

        public function WorkerBonus(_arg1:XML){
            super(_arg1);
            this.m_featureName = _arg1.@featureName;
        }
        override public function init(_arg1:MapResource):void{
            this.m_harvestableResource = (_arg1 as HarvestableResource);
            var _local2:Workers = Global.factoryWorkerManager.getWorkers(this.m_harvestableResource.getWorkerBucket());
            var _local3:int;
            if (_local2){
                _local3 = _local2.getWorkerCount();
            };
            m_percentModifier = (initialPercentModifier * _local3);
        }
        override public function get maxPercentModifier():Number{
            var _local1:Item = this.m_harvestableResource.harvestingDefinition;
            var _local2:int;
            if (((_local1.workers) && (_local1.workers.members))){
                _local2 = _local1.workers.members.length;
            };
            return ((initialPercentModifier * _local2));
        }

    }
}//package Classes.bonus 
